package cn.java75;

import cn.java75.aop.entity.Student;
import cn.java75.aop.serivce.StudentServiceI;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Arrays;

/**
 * @author oldliu
 * @since 1.0
 */
public class AopTest {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("app*.xml");
        StudentServiceI userService = context.getBean("userService", StudentServiceI.class);
        System.out.println(userService.getClass().getName()+"类名");
        Class<?>[] interfaces = userService.getClass().getInterfaces();
        System.out.println("实现的接口:"+ Arrays.toString(interfaces));
        System.out.println("父类:"+userService.getClass().getSuperclass());
        System.out.println("属性:"+Arrays.toString(userService.getClass().getDeclaredFields()));
        Student stu=new Student();
        stu.setPass("!44443444");
        stu.setSname("老吴");
        int add = userService.add(stu);
        System.out.println(add+"返回了");


    }
}
